package com.ctshk.rpc.user.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 *  收货地址REQ
 * </p>
 *
 * @author 李新科
 * @date 2021/5/17 11:35
 */
@Data
@ApiModel()
@Accessors(chain = true)
public class UserReceivingAddressReq implements Serializable {

    @ApiModelProperty(name = "id", value = "id,修改时传入")
    private Long id;

    @ApiModelProperty(value="收货人名称")
    @NotBlank(message = "请填写姓名")
    @Size(max = 20,message = "姓名最大为20个字符")
    private String consigneeName;

    @ApiModelProperty(value="用户id")
    private Long userId;

    @ApiModelProperty(value="收货人手机区号Id")
    private Long consigneeMobileAreaCodeId;

    @ApiModelProperty(value="收货人手机区号")
    private String consigneeMobileAreaCode;

    @ApiModelProperty(value="收货人手机号码")
    @Pattern(regexp = "^[0-9]{8,11}$", message = "手机号必须是纯数字,并且是8到11位")
    private String consigneeMobileNumber;

    @ApiModelProperty(value="邮政编码")
    @Size(max = 6,message = "邮政编码最大为6个字符")
    private String postalCode;

    @ApiModelProperty(value="地区类型")
    private Integer areaType;

    //@ApiModelProperty(value="所在区域(国家+省+市+区)")
    //private String region;

    @ApiModelProperty(value="详细地址")
    @Size(max = 20,message = "地址最大为20个字符")
    private String address;

    @ApiModelProperty(value="是否默认地址,0否1是")
    private Integer isDefalutAddress;

    @ApiModelProperty(value="区域主键id,最后一级位置的id,比如最后一级为xx区(xx市/省/国家),则传改xx区(xx市/省/国家)的id")
    @NotNull(message = "locationId不能为空")
    private Long locationId;

}
